const { Menu, BrowserWindow } = require('electron');  //引入

let template = [
    {
        label: 'home',   //父菜单
        accelerator: 'ctrl+p', // 设置快捷键
        click: () => {
            BrowserWindow.getFocusedWindow().loadURL(process.env.winURL + '')
        }
    },
    {
        label: 'about',   //父菜单
        accelerator: 'ctrl+m', // 设置快捷键
        click: () => {
            BrowserWindow.getFocusedWindow().loadURL(process.env.winURL + 'about')
        }
    },

]

let m = Menu.buildFromTemplate(template);
Menu.setApplicationMenu(m);   //设置程序的菜单